import React from 'react'
import { Input} from 'antd'
import { useDispatch } from 'react-redux'

import { getPmmlList } from '../../../redux/actions/pmml/pmmlAction'

const { Search } = Input;

const SearchBtn = props => {

    // 获取store对象中dispatch的引用
    const dispatch = useDispatch()

    const onSearch = value => {
        dispatch(getPmmlList(0, value))
    }

    return (
        <>
            <Search
                placeholder="请输入搜索关键字"
                allowClear
                enterButton="Search"
                size="large"
                onSearch={onSearch}
            />
        </>
    )
}

export default SearchBtn